package com.show.business.device.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.show.business.common.core.domain.AjaxResult;
import com.show.business.device.bean.DeviceGroupAlarmPhone;
import com.show.business.device.mapper.DeviceGroupAlarmPhoneMapper;
import com.show.business.device.service.IDeviceGroupAlarmPhoneService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 设备分组手机设置 服务实现类
 * </p>
 *
 * @author dvlp
 * @since 2024-09-30
 */
@Service
public class DeviceGroupAlarmPhoneServiceImpl extends ServiceImpl<DeviceGroupAlarmPhoneMapper, DeviceGroupAlarmPhone> implements IDeviceGroupAlarmPhoneService {
    @Resource
    private DeviceGroupAlarmPhoneMapper deviceGroupAlarmPhoneMapper;

    @Override
    public List<DeviceGroupAlarmPhone> getList(DeviceGroupAlarmPhone deviceGroupAlarmPhone) {
        return baseMapper.getList(deviceGroupAlarmPhone);
    }

    @Override
    public AjaxResult saveInfo(DeviceGroupAlarmPhone deviceGroupAlarmPhone) {
        baseMapper.insert(deviceGroupAlarmPhone);
        return AjaxResult.success();
    }

    @Override
    public AjaxResult editInfo(DeviceGroupAlarmPhone deviceGroupAlarmPhone) {
        baseMapper.updateById(deviceGroupAlarmPhone);
        return AjaxResult.success();
    }

    @Override
    public AjaxResult getInfo(String id) {
        return AjaxResult.success(baseMapper.selectById(id));
    }

    @Override
    public AjaxResult delInfo(String id) {
        baseMapper.updateDel(id);
        return AjaxResult.success();
    }
    @Override
    public AjaxResult delInfos(String[] ids) {
        for(String id:ids){
            baseMapper.updateDel(id);
        }
        return AjaxResult.success();
    }
}
